/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package trabalho1;

/**
 *
 * @author geraldo
 */
public class Resultado {
    
    public static final String FORCA_MUITO_FRACO = "very weak";
    public static final String FORCA_FRACO = "weak";
    public static final String FORCA_MEDIO = "medium";
    public static final String FORCA_FORTE = "strong";
    public static final String FORCA_MUITO_FORTE = "stronger";
    public final String forca[] = {FORCA_MUITO_FRACO, FORCA_FRACO, FORCA_MEDIO, FORCA_FORTE, FORCA_MUITO_FORTE};
  
    public final int valores[] = {20, 40, 60, 80, Integer.MAX_VALUE};

    public void complexidade(int  nScore) {
        
    String sComplexity = "";    
    
     for (int i = 0; i < valores.length; i++) {
            if (nScore < valores[i]) {
                sComplexity = forca[i];
                System.out.println("Strength verdict: " + sComplexity);
                break;
            }
        }            
                System.out.println("Strength verdict: " + sComplexity);    
    }
    
   public void requerimento(String pwd,int nMinPwdLen,int nRequirements,int nScore,String sRequirements){
       
       int nMinReqChars;
                if (pwd.length() >= nMinPwdLen) { nMinReqChars = 3; } else { nMinReqChars = 4; }
                if (nRequirements > nMinReqChars) {
                        nScore = nScore + nRequirements * 2;
                        sRequirements = "+ " + nRequirements * 2;
                }
                        System.out.println("nRequirementsBonus is: " + sRequirements);
   }
   
        public int retornaInteiro(int nLength, int nAlphaUC, int nAlphaLC, int nNumber, int nSymbol, int nMinPwdLen, int nReqChar) {
        int[] arrChars = { nLength, nAlphaUC, nAlphaLC, nNumber, nSymbol };
        String[] arrCharsIds = { "nLength", "nAlphaUC", "nAlphaLC", "nNumber", "nSymbol" };
        int arrCharsLen = arrChars.length;
        for (int c=0; c < arrCharsLen; c++) {
                int minVal;
                if (arrCharsIds[c].equals("nLength")) { minVal = nMinPwdLen - 1; } else { minVal = 0; }
                if (arrChars[c] == (minVal + 1)) { nReqChar++; }
                else if (arrChars[c] > (minVal + 1)) { nReqChar++; }
        }
        return nReqChar;
    }
}
